#pragma once
#include "spi.h"
void spi0_flash_init(void);
uint32_t spi0_flash_read_id(void);
void spi0_flash_wait_readly(void);
void spi0_flash_write_enable();
uint8_t spi0_flash_erase_all(void);
void spi0_flash_erase_sector(uint32_t addr);
void spi0_flash_write_sector(uint16_t sector_num, uint8_t *write);
void spi0_flash_read(uint32_t addr, uint8_t *read, uint32_t length);
void spi0_flash_write(uint32_t addr, uint8_t *write, uint32_t length);
void spi0_flash_erase(uint32_t addr, uint32_t length);